{{- if not .Values.upmeter.smokeMiniDisabled }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: smoke-mini
  namespace: d8-{{ .Chart.Name }}
  {{- include "helm_lib_module_labels" (list . (dict "app" "smoke-mini")) | nindent 2 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: d8:{{ .Chart.Name }}:smoke-mini
  {{- include "helm_lib_module_labels" (list . (dict "app" "smoke-mini")) | nindent 2 }}
rules:
- apiGroups: ["monitoring.coreos.com"]
  resources: ["prometheuses/http"]
  resourceNames: ["main", "longterm"]
  verbs: ["get"]
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:{{ .Chart.Name }}:smoke-mini
  {{- include "helm_lib_module_labels" (list . (dict "app" "smoke-mini")) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:{{ .Chart.Name }}:smoke-mini
subjects:
- kind: ServiceAccount
  name: smoke-mini
  namespace: d8-{{ .Chart.Name }}
{{- end }}
